package org.jeecg.modules.system.simple;

import org.jeecg.common.util.PasswordUtil;
import org.junit.jupiter.api.Test;

/**
 * @author zgn
 * @Description: 模板Junit
 * @date 2022/1/13 0013
 */
public class PawJunit {
    @Test
    public void egMin() {//e.g.
        System.out.println();
    }

    @Test
    public void 密码解密_egMin() {//e.g. √解密的是用户名
        //String ciphertext = "cb362cfeefbf3d8d",  password = "123456",  salt = "RCGTeGiH";
        String ciphertext = "2b46ce267124478f",  password = "jeecg",  salt = "mIgiYJow";
        System.out.println(PasswordUtil.decrypt(ciphertext, password, salt));
    }

    @Test
    public void 密码加密_egMin() {//e.g. √
        //String username = "admin",  password = "123456",  salt = "RCGTeGiH"; √
        //58a714412072f0b9 ;
        //admin ×;123456 ×;
        String username = "jeecg",  password = "jeecg",  salt = "mIgiYJow";
        String userpassword = PasswordUtil.encrypt(username, password, salt);

        System.out.println(userpassword);
    }

    @Test
    public void egMax() {//e.g.
        //region 模拟数据
        System.out.println("--------------------Start--------------------");
        //endregion

        //region 数据处理
        System.out.println("--------------------Deal--------------------");
        //endregion

        //region 数据展示
        System.out.println("--------------------Done--------------------");
        //endregion
    }
}
